#! /bin/sh

BINNAME_LONG="$(basename $0)"
BINNAME="${BINNAME_LONG%-tc}"

if [ -n "${HELIUM_TEMP}" ]; then
	TEMP="${HELIUM_TEMP}";
else
	TEMP="/tmp/helium-${USER}"	
	if ! [ -d "${TEMP}" ]; then
		mkdir ${TEMP};
	fi;
fi

# if [ "${BINNAME_LONG}" = "${BINNAME}" ]; then
#	HELIUM_LIBS="/usr/lib/helium/lib/simple";
# else
HELIUM_LIBS="/usr/lib/helium/lib";
# fi

if [ -z "${LVMPATH}" ]; then
	LVMPATH=".:${HELIUM_LIBS}";
else
	LVMPATH="${LVMPATH}:${HELIUM_LIBS}";
fi
export LVMPATH
export TEMP

PROGCALL="/usr/lib/helium/bin/${BINNAME}"

${PROGCALL} $*
